<?php
/**
 * $Id: form.php 7 2010-04-26 20:05:00Z webbochsant $
 *  @package	Joomla
 *  @author Daniel Eliasson
* 	@copyright	Copyright (C) 2010 Stilero. All rights reserved.
* 	@license	GNU/GPL, see LICENSE.php
* 	Joomla! is free software. This version may have been modified pursuant
* 	to the GNU General Public License, and as distributed it includes or
* 	is derivative of works licensed under the GNU General Public License or
* 	other free or open source software licenses.
*/

// no direct access
defined('_JEXEC') or die('Restricted access'); 

//Load calendar functions
JHTML::_('behavior.calendar');

?>
	<script language="javascript" type="text/javascript">
		<!--
		/*
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			// do field validation
			if (form.title.value == "") {
				alert( "<?php echo JText::_( 'You must provide a competition title.', true ); ?>" );
			} else if (getSelectedValue('adminForm','pid') < 1) {
				alert( "<?php echo JText::_( 'Please select a product.', true ); ?>" );
			} else {
				submitform( pressbutton );
			}
		}
		*/
		//-->
		</script>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<div class="col100">
			<fieldset class="adminform">
				<legend><?php echo JText::_( 'Details' ); ?></legend>

				<table class="admintable">
				<tbody>
					<tr>
						<td width="20%" class="key">
							<label for="title">
								<?php echo JText::_( 'Title' ); ?>:
							</label>
						</td>
						<td width="80%">
							<input class="inputbox" type="text" name="title" id="title" size="50" value="<?php echo $this->competition->title;?>" />
						</td>
					</tr>
					<tr>
						<td width="20%" class="key">
							<label for="alias">
								<?php echo JText::_( 'Alias' ); ?>:
							</label>
						</td>
						<td width="80%">
							<input class="inputbox" type="text" name="alias" id="alias" size="50" value="<?php echo $this->competition->alias;?>" />
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<label for="description">
								<?php echo JText::_( 'Description/Notes' ); ?>:
							</label>
						</td>
						<td>
							<?php
									$editor =& JFactory::getEditor();
				$params = array( 
				'smilies'=> '0' ,
                 'style'  => '1' ,  
                 'layer'  => '0' , 
                 'table'  => '0' ,
                 'clear_entities'=>'0'
                 );
								echo $editor->display( 'description', $this->competition->description, '500', '200', '20', '20', false, $params );
								
								?>
						</td>
					</tr>
					<tr>
						<td class="key">
							<label for="pid">
								<?php echo JText::_( 'VM Product' ); ?>:
							</label>
						</td>
						<td>
							<?php //echo $this->lists['pid']; ?>
							<?php print JHTML::_('select.genericlist',   $this->productlist, 'pid', 'class="inputbox" size="1"','product_id', 'fullproduct', $this->competition->pid );?>
						</td>
					</tr>
					<tr>
						<td class="key">
							<label for="imageurl">
								<?php echo JText::_( 'Competition Start' ); ?>:
							</label>
						</td>
						<td>
							<input class="inputbox" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $this->competition->publish_up;?>" />
							<input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', '%Y-%m-%d 00:00:00');" />
						</td>
					</tr>
					<tr>
						<td class="key">
							<label for="publish_down">
								<?php echo JText::_( 'Competition End' ); ?>:
							</label>
						</td>
						<td>
							<input class="inputbox" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $this->competition->publish_down;?>" />
							<input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', '%Y-%m-%d 00:00:00');" />
						</td>
					</tr>
					<tr>
						<td colspan="3">
						</td>
					</tr>
				</tbody>
				</table>
			</fieldset>
		</div>
		<div class="clr"></div>

 
<input type="hidden" name="option" value="com_vmcompetition" />
<input type="hidden" name="id" value="<?php echo $this->competition->id; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="vmcompetition" />
</form>
